package demo04;

import java.io.Serializable;

public class Student implements Serializable { // 数组内的学生对象也需要实现可序列化接口
    private String name;
    private int age;
    private static String room = "classA";

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static String getRoom() {
        return room;
    }

    public static void setRoom(String room) {
        Student.room = room;
    }

    @Override
    public String toString() {
        return "Student [age=" + age + ", name=" + name + ", room=" + room + "]";
    }
}
